var wineApp = wineApp || {};
wineApp.member = (function() {
    var initPage = function() {
        loadMember();
    }

    var loadMember = function() {
        var ajaxUrl = wineApp.CONFIG.API.myagents;
        wineApp.ajax.post(ajaxUrl, {})
            .done(function(data) {
                var list = "<ul>";
                if (data.up) {
                    $('#upper').html(data.up.name);
                }
                $.each(data.downs, function(index, val) {
                    var img = "../images/nohead.jpg"
                    if (!_.isEmpty(val.logo)) {
                        img = val.logo;
                    }
                    list += '<li>' +
                        '<img src="' + img + '"><b>' + val.name + '</b>' +
                        '<div style="float:right"><b>会员数:<label>' +
                        (val.down1 +
                            val.down2 +
                            val.down3) +
                        '</label></b></div>' +
                        '</li>';
                });
                list += '</ul>';
                $('.myxiaji').append(list);
            });
    }
    return {
        initPage: initPage
    }
})();

$(document).ready(function() {
    //$('.wine_footer').remove();
    wineApp.common.initHeaderIcon(0, true, {
        camera: false,
        search: false
    });
    wineApp.member.initPage();
    //wineApp.common.initTabs('#tabs');
});